// D3DDeviceDrvEffect.cpp (c) 2011 JV Software
//

#include "D3DDeviceDrvPrivate.h"

/*
===================
D3DDeviceDrvEffect::LoadEffect
===================
*/
void D3DDeviceDrvEffect::LoadEffect( byte *buffer, int len ) {
	ID3DBlob *shaderBlob, *debugBlob;

	memory->AllowMemoryModification();

	// Compile the effect from memory.
	if(FAILED(D3DX11CreateEffectFromMemory( buffer, len, 0, d3dDevice.Device(), &handle))) {
		engine->FatalError( TEXT("D3DX11CreateEffectFromMemory: Failed\n") );
	}

	memory->DisallowMemoryModification();
}

/*
===================
D3DDeviceDrvEffect::Destroy
===================
*/
void D3DDeviceDrvEffect::Destroy( void ) {
	memory->AllowMemoryModification();
	handle->Release();
	memory->DisallowMemoryModification();
}